package com.jnshu.controller;

import com.jnshu.service.UpLoadPhotoService;
import com.jnshu.tools.AliyunUtilImage;
import com.jnshu.tools.resultUtils.RUtil;
import com.jnshu.tools.resultUtils.ResultBean;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName UpLoadPhoto
 * @Descrintion
 * @Author bd
 * @Date 2019/8/6 12:04
 * @Version 1.0
 **/
@Log
@RestController
public class UpLoadPhoto {

    @Autowired(required = false)
    UpLoadPhotoService upLoadPhotoService;
    @PostMapping("/course/image")
    public ResultBean image(@RequestParam("file") MultipartFile file) {
        log.info("feign传过来的图片名字为：" + file.getOriginalFilename() + "图片类型为" + file.getContentType());
        return upLoadPhotoService.image(file);
    }

}
